<?php
require('./inc/common.php');
$param = getParam($_GET);

$sql = "SELECT *
       FROM  zj_jigou
       WHERE jigou_title LIKE '".$param['k']."%'
		OR jigou_brand LIKE '".$param['k']."%'
       ORDER BY jigou_id ASC
		LIMIT 1;
	";

$result = mysql_query($sql);

if($row = mysql_fetch_assoc($result)) {
	$jigouData[0] = array(
		'id' => $row['jigou_id'],
		'cityid' => 11,
		'areacode' => 000100110114,
        'name' => $row['jigou_title'],
        'comm_score' => $row['jigou_rate'],
        'alias_name' => $row['jigou_brand'],
        'address' => $row['jigou_address'],
        'icon_img' => '16,community/20100922/1/45/5/42/92/145054292/420x315.jpg',
        'usetype' => 1,
        'showcommexpert' => 0,
        'glat' => $row['jigou_map_lat'],
        'glng' => $row['jigou_map_lng'],
        'lat' => $row['jigou_map_lat'],
        'lng' => $row['jigou_map_lng']
	);
}else {
	$jigouData = array();
}
mysql_free_result($result);
header('Content-type: application/json');
echo json_encode($jigouData);